package cn.sourcespro.spring.service.impl;

import cn.sourcespro.spring.dao.RoleMapper;
import cn.sourcespro.spring.entity.Role;
import cn.sourcespro.spring.service.RoleService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 角色
 *
 * @author 张浩伟
 * @date 2018/07/25
 */
@Service
public class RoleServiceImpl implements RoleService {

    private static final Logger logger = LoggerFactory.getLogger(RoleServiceImpl.class);

    @Autowired
    private RoleMapper mapper;

    @Override
    public Role add(Role record) {

        int result = mapper.insert(record);
        if (result > 0) {
            return record;
        }
        return null;
    }
}